import { Button } from "antd";
import { useAuth } from "../context/AuthContext";

export default function Page3() {
  const { authButtons } = useAuth();

  return (
    <div>
      <h2>这是菜单项3对应的页面内容</h2>
      <p>这里是一些静态内容，您可以根据需要进行修改。</p>

      {/* 只有有 page3:view 权限才显示 */}
      {authButtons.includes("page3:view") && (
        <Button type="primary" onClick={() => { /* ... */ }}>
          view按钮
        </Button>
      )}

      {/* 只有有 page3:edit 权限才显示 */}
      {authButtons.includes("page3:edit") && (
        <Button type="dashed" style={{ marginLeft: 8 }}>
          edit按钮
        </Button>
      )}

      {/* 只有有 page3:delete 权限才显示 */}
      {authButtons.includes("page3:delete") && (
        <Button danger style={{ marginLeft: 8 }}>
          delete按钮
        </Button>
      )}
    </div>
  );
}